-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PMCD returned by mappinganalysis to build minimal graph for query #3488
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b505283 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2375853
to
b8520b0
Compare
aab4beb
to
e84388e
Compare
packages/legend-application-query/src/components/Core_LegendQueryApplicationPlugin.tsx
Show resolved
Hide resolved
HEADS-UP: To fix (regressions)
|
packages/legend-application-query/src/stores/data-space/DataSpaceQueryCreatorStore.ts
Outdated
Show resolved
Hide resolved
packages/legend-query-builder/src/stores/workflows/ServiceQueryBuilderState.ts
Show resolved
Hide resolved
...-data-space/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts
Outdated
Show resolved
Hide resolved
packages/legend-extension-dsl-data-space/src/stores/query-builder/DataSpaceQueryBuilderState.ts
Outdated
Show resolved
Hide resolved
packages/legend-application-query/src/stores/QueryEditorStore.ts
Outdated
Show resolved
Hide resolved
packages/legend-graph/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts
Outdated
Show resolved
Hide resolved
e84388e
to
0e47202
Compare
packages/legend-graph/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts
Outdated
Show resolved
Hide resolved
c4c51c2
to
ca56d82
Compare
packages/legend-extension-dsl-data-space/src/stores/query-builder/DataSpaceQueryBuilderState.ts
Show resolved
Hide resolved
e9fe026
to
136f682
Compare
...-data-space/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts
Show resolved
Hide resolved
136f682
to
c4ee4a9
Compare
packages/legend-application-query/src/components/Core_LegendQueryApplicationPlugin.tsx
Outdated
Show resolved
Hide resolved
packages/legend-application-query/src/components/Core_LegendQueryApplicationPlugin.tsx
Show resolved
Hide resolved
e647ba8
to
06dbe27
Compare
3dab2fd
to
2d8d949
Compare
...-data-space/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts
Outdated
Show resolved
Hide resolved
...-data-space/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts
Show resolved
Hide resolved
a5fc146
to
c6d7af2
Compare
packages/legend-graph/src/graph-manager/action/analytics/MappingModelCoverageAnalysis.ts
Show resolved
Hide resolved
mapping!: PackageableElementReference<Mapping>; | ||
runtime!: PackageableElementReference<PackageableRuntime>; | ||
// NOTE: Query can be built before the actual graph is built so we can't have the reference of metamodels here | ||
mapping!: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to make this change, shouldnt the graph already be build with a stub mapping and runtime for this not to have to change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setUpEdtiorState() has been updated to fetch query instead of LightQuery anymore
https://github.com/finos/legend-studio/pull/3488/files#diff-5dae4710ada9d402191df7256d5cc7d4502e3b40a8f1b9acf960143f7ee6adfeR1293
Therefore, it needs to be changed to use string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reasoning for this change.
We have 3 models for Stored Query.
Query, Light Query and Query Info.
The Query one should be the compiled resolved one if we ever need it. the other two are unresolved ones using string paths etc.
So we should not be changing Query to strings.
Depends on what exactly you need in scope.
Maybe you just need QueryInfo ?
...-data-space/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts
Outdated
Show resolved
Hide resolved
@@ -39,13 +39,14 @@ export enum DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN { | |||
GAV = 'gav', | |||
DATA_SPACE_PATH = 'dataSpacePath', | |||
TEMPLATE = 'template', | |||
EXECUTION_CONTEXT = 'executionContext', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think we need this.
packages/legend-query-builder/src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx
Outdated
Show resolved
Hide resolved
packages/legend-query-builder/src/components/fetch-structure/QueryBuilderTDSPanel.tsx
Outdated
Show resolved
Hide resolved
packages/legend-query-builder/src/components/fetch-structure/QueryBuilderTDSPanel.tsx
Outdated
Show resolved
Hide resolved
@@ -39,6 +39,7 @@ export enum DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN { | |||
GAV = 'gav', | |||
DATA_SPACE_PATH = 'dataSpacePath', | |||
TEMPLATE = 'template', | |||
EXECUTION_CONTEXT = 'executionContext', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think this is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed as when trying to build minimal graph, mapping and pmcd are fetched from corresponding sexecutionContext key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still don't understand. DataspaceInfo should have the template info( which we get from the template id) which has the executon context we need ? right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the entry point of building DataspaceAnalyticsResult and light graph is built when building DataspaceAnalyticsResult.
Based on current implementation, template info is built at the last step
packages/legend-application-query/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts
Outdated
Show resolved
Hide resolved
@@ -63,6 +65,10 @@ export type NewQueryNavigationPath = ( | |||
editorStore: ExistingQueryEditorStore, | |||
) => string | undefined; | |||
|
|||
export type QueryGraphBuilderGetter = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in https://github.com/finos/legend-studio/pull/3488/files#diff-5dae4710ada9d402191df7256d5cc7d4502e3b40a8f1b9acf960143f7ee6adfeR690
This is for loading an empty function to aovid buildFullGraph
for ExistingQueryEditorStore with dataspace context only
packages/legend-application-query/src/components/QueryEditor.tsx
Outdated
Show resolved
Hide resolved
packages/legend-application-query/src/components/data-space/DataSpaceInfo.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a better strategy for the things we have started caching that just a bunch of ifs and checking for info. I think we should change the source of truth for UI to be dataspace info on some of the dataspace specific feature. Im worried about the cost to maintain a lot of this code or even to test it is great.
I think how we built the dataspace info will be determined by whether we get the info from the full graph or the cache dataspace analysis result.
We may want to have a method to determine that this dataspace analysis result is expected to have all this new info (executable and template stuff), maybe adding a version on analysis result and saying if it has version x then we know it has all these fields are expected. Or maybe if the minimal graph is there then we know that it is expected to have this new info. If it has all this new info then we use the cached datasapce info to built it, if not we use the full graph to build this dataspace info.
From the dataspace info is all we need to render these helper forms.
1296d4d
to
70164b2
Compare
70164b2
to
00d615e
Compare
packages/legend-application-query/src/stores/QueryEditorStore.ts
Outdated
Show resolved
Hide resolved
mapping!: PackageableElementReference<Mapping>; | ||
runtime!: PackageableElementReference<PackageableRuntime>; | ||
// NOTE: Query can be built before the actual graph is built so we can't have the reference of metamodels here | ||
mapping!: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reasoning for this change.
We have 3 models for Stored Query.
Query, Light Query and Query Info.
The Query one should be the compiled resolved one if we ever need it. the other two are unresolved ones using string paths etc.
So we should not be changing Query to strings.
Depends on what exactly you need in scope.
Maybe you just need QueryInfo ?
return queryExeContext; | ||
} | ||
|
||
async propagateExecutionContextChange( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[can help] I don't think the extension (getExtraQueryBuilderPropagateExecutionContextChangeHelper
) makes much sense. Looking at the implementation you are using only the flags of QueryEditorStore. Maybe we can add include if we use the minimal graph as an input to DataSpaceQueryBuilderState
We should be able to use the input to implement this in DataSpaceQueryBuilderState
. We have
onExecutionContextChange
and should have the flags needed in scope
packages/legend-application-query/src/application/LegendQueryApplicationConfig.ts
Outdated
Show resolved
Hide resolved
supportBuildMinimalGraph | ||
) { | ||
try { | ||
const stopWatch = new StopWatch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additionally below code is repeated.
We should have a buildDataspaceMinialGraph in V1_DSL_DataSpace_PureGraphManagerExtension
that takes in minimalEntities, dataspaceInfo, executionKeyToBuild,
and builds the required graph. I think we already have this logic in V1_DSL_DataSpace_PureGraphManagerExtension
@@ -603,6 +603,12 @@ export const QueryEditor = observer(() => { | |||
!engineConfig.useClientRequestPayloadCompression, | |||
); | |||
|
|||
const toggleEnableMinialGraphForDataSpaceLoadingPerformance = (): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesnt this change the local storage value ?
the changes to the editors to take info look good (took a quick look) but we need to add tests for these rendering components. do we have any at the moment, didnt see we change any so i assume we don't ? |
...ges/legend-extension-dsl-data-space/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx
Outdated
Show resolved
Hide resolved
8cc3319
to
987b5c7
Compare
987b5c7
to
04837d5
Compare
Summary
Use PMCD returned by mappinganalysis to build minimal graph for query
clean/update: #2523
How did you test this change?
Screen.Recording.2024-09-26.at.10.28.48.PM.mov
enable switch to load full graph
Screen.Recording.2024-09-26.at.10.27.01.PM.mov